package com.junxonline.instant.dao.mapper.device;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.junxonline.instant.dao.entity.model.device.Terminal;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 终端信息表Mapper
 *
 * @author JunX
 * @date 2021-09-27
 */
@Repository
public interface TerminalMapper extends BaseMapper<Terminal> {

    IPage<Terminal> queryList(Page<Terminal> page, @Param("ew") Wrapper<Terminal> wrapper);// @Param("proProcess") String programProcess, @Param("apkProcess") String apkProcess

    List<Terminal> queryList(@Param("ew") Wrapper<Terminal> wrapper);

    Terminal selectById(@Param("id") Long id);

    Terminal selectByCode(@Param("code") String code);

    void updateStatusByCode(@Param("status") Integer status, @Param("code") String code);

    void updateStatusOfflineByCode(@Param("status") Integer status, @Param("code") String code);

    void updateStatusAndHeartBeatTimeByCode(@Param("status") Integer status, @Param("heartBeatTime") Date date, @Param("code") String code);

}
